//
//  LYSpecialLabelCell.m
//  SelectCity
//
//  Created by liuyan on 2019/3/14.
//  Copyright © 2019年 liuyan. All rights reserved.
//

#import "LYSpecialLabelCell.h"

@interface LYSpecialLabelCell()

@property (nonatomic, strong) UILabel *titleLabel;

@end

@implementation LYSpecialLabelCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self initUI];
    }
    return self;
}
- (void)initUI {
    _titleLabel = [[UILabel alloc] init];
    _titleLabel.textAlignment = NSTextAlignmentCenter;
    _titleLabel.font = Font(Font_14);
    _titleLabel.userInteractionEnabled = NO;
    [self.contentView addSubview:_titleLabel];
}
- (void)setModel:(PublicCategoryElementModel *)model {
    _titleLabel.frame = CGRectMake(0, 0, model.itemWidth, 30*Scale);
    _titleLabel.text = model.name;
    _titleLabel.layer.cornerRadius = 5*Scale;
    _titleLabel.clipsToBounds = YES;
    if (model.isSelect) {
        _titleLabel.backgroundColor = THEMECOLOR_OF_ORANGE;
        _titleLabel.layer.borderWidth = 0;
        _titleLabel.textColor = COLOR_OF_WHITE;
    } else {
        _titleLabel.backgroundColor = COLOR_OF_WHITE;
        _titleLabel.layer.borderWidth = lineH;
        _titleLabel.layer.borderColor = THEMECOLOR_OF_TEXT_cccccc.CGColor;
        _titleLabel.textColor = THEMECOLOR_OF_TEXT_666666;
    }
}

@end
